package hc.bre.deci.action

import hc.bre.cmn.ListOption
import hc.bre.cmn.struct.DataStructItem
import hc.bre.data.encoder.EncoderDefinition
import hc.bre.data.encoder.EncoderItem
import hc.bre.data.encoder.EncoderStruct

@groovy.transform.CompileStatic
class EncoderSetter extends ActionBuilder{
	@Override
	public String getActionResult() {
		EncoderDefinition ret = builder.<EncoderDefinition>rule(act.refer as String);
		return "${builder.referRuleClass(ret)}.${ret.accessRouteOf(input as Integer)}"
//		EncoderItem coder = ret.find(input as Integer)
//		return "${builder.referRuleClass(ret)}.${coder.code}"
	}

	@Override
	public DataStructItem getResultStructItem() {
		return new EncoderStruct().root;
	}
}
